#pragma once

#ifndef NODEOPENGLTEST_H
#define NODEOPENGLTEST_H


#include<QOpenGLWidget>
#include<QOpenGLBuffer>
#include<QOpenGLFunctions_3_3_Core>
#include<QOpenGLShader>
#include<QOpenGLShaderProgram>
#include<vector>
// diff of QOpenGL_ and QGL_


//https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/
//https://www.jianshu.com/u/fa0aa5b06c8c
class NodeOpenGLTest : public QOpenGLWidget,
        protected QOpenGLFunctions_3_3_Core
{
public:
    explicit NodeOpenGLTest(QWidget *parent = nullptr);
    ~NodeOpenGLTest();


protected:
    // virtual or override
    void initializeGL() override;
    void resizeGL(int w,int h) override;
    void paintGL() override;

private:
    // GLuint or unsigned int
    unsigned int VAO;
    unsigned int VBO;
    unsigned int EBO;  // OpenGL调用顶点的索引来决定该绘制哪个顶点

    QOpenGLShaderProgram shaderProgram;


};
struct vec3{
    float x;
    float y;
    float z;
};

#endif // NODEOPENGLTEST_H
